﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Data.SqlServerCe;
using System.Data;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {

//            var x = TuiTest.Customer.Read();

        //    OldWay();
            KeaTest.Kea.Test();
        }

        private static void OldWay()
        {
            using (SqlCeConnection cnn = new SqlCeConnection(@"data source='C:\Users\admin\Documents\Visual Studio 2008\Projects\TRW\NewSolution 3\Northwind.sdf'"))
            {
                cnn.Open();
                using (SqlCeCommand cmd = new SqlCeCommand("Products", cnn))
                {
                    cmd.CommandType = CommandType.TableDirect;
                    cmd.IndexName = "Category ID";
                    //                    cmd.SetRange(DbRangeOptions.InclusiveStart | DbRangeOptions.InclusiveEnd, new object[] { 5 }, new object[] { 7 });
                    using (SqlCeDataReader dr = cmd.ExecuteReader())
                    {
                        foreach (int id in new int[] { 3, 6, 7 })
                        {
                            if (dr.Seek(DbSeekOptions.AfterEqual, id))
                            {
                                while (dr.Read() && id.Equals(dr["Category ID"]))
                                {
                                    object x = dr[3];
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
